const request = {
	get(url, data) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: url,
				data: {
					...data,
				},
				header: {
					'Accept': 'application/json',
					'Content-Type': 'application/x-www-form-urlencoded',
				},

				method: "GET",
				success: (response) => {
					resolve(response)
				},
				fail: (error) => {
					reject(error.response)
				},
			});
		})

	},
	post(url, data) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: url,
				data: data,
				header: {
					'Accept': 'application/json',
					'Content-Type': 'application/json',
				},
				method: "POST",
				success: (response) => {
					resolve(response)
				},
				fail: (error) => {
					reject(error.response)
				},
			});
		})
	},
}
export default request
